<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>gfast博客</title>
    <link href="${.domain}plugin/blog/css/base.css" rel="stylesheet">
    <link href="${.domain}css/swiper-6.1.1/swiper-bundle.min.css" rel="stylesheet">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <script src="${.domain}js/jquery/jquery.js"></script>
    <script src="${.domain}plugin/blog/js/nav.js"></script>
    <script src="${.domain}js/swiper-6.1.1/swiper-bundle.min.js"></script>
</head>
<body>
${template "header" .}
<!--header end-->
<main>
    <article>
        <!-- 图片滑动 -->
        <div class="swiper-container">
            <div class="swiper-wrapper">
                ${range $index,$article := .slideList}
                <div class="swiper-slide"><a href="${$.domain}plugin/blog/content?logId=${$article.LogId}" target="_blank"><img src="${$.domain}${$article.LogThumbnail}"></a></div>
                ${end}
            </div>
            <!-- 分页器 -->
            <div class="swiper-pagination"></div>
            <!-- 导航按钮 -->
            <div class="swiper-button-prev"></div>
            <div class="swiper-button-next"></div>
        </div>
        <!--top_blog 置顶文章 begin-->
        <div class="top_blog">
            <ul class="blogs">
                ${range $index,$article := .topList}
                <li>
                    <a href="${$.domain}plugin/blog/content?logId=${$article.LogId}" target="_blank">
                        <i><img src="${$.domain}${$article.LogThumbnail}" alt="标题图片"></i>
                        <h2>${$article.LogTitle}</h2>
                    </a>
                    <div class="blog_smalltext">${subStr $article.LogContent 23}</div>
                    <p class="blog_info">
                        <span>${timeFormatYear $article.CreatTime}</span>
                        <span>${$article.LogAuthor}</span>
                        <span>${$article.ClassificationName}</span>
                        <span>${$article.LogHits}</span>
                    </p>
                </li>
                ${end}
            </ul>
        </div>
        <!--top_blog 置顶文章 end-->

        <!--new_blog 最新文章 begin-->
        <div class="new_blog">
            <ul class="blogs">
                ${range $index,$article := .logList}
                    ${if ne $article.LogSign 1}
                    <li>
                        <a href="${$.domain}plugin/blog/content?logId=${$article.LogId}" target="_blank">
                            <i><img src="${$.domain}${$article.LogThumbnail}" alt="标题图片"></i>
                            <h2>${$article.LogTitle}</h2>
                        </a>
                        <div class="blog_smalltext">${subStr $article.LogContent 23}</div>
                        <p class="blog_info">
                            <span>${timeFormatYear $article.CreatTime}</span>
                            <span>${$article.LogAuthor}</span>
                            <span>${$article.ClassificationName}</span>
                            <span>${$article.LogHits}</span>
                        </p>
                    </li>
                    ${end}
                ${end}
            </ul>
        </div>
        <!--new_blog 最新文章 end-->

    </article>
    <!--article end-->

    ${template "aside" .}
    <!--aside end-->
</main>
${template "footer" .}

<script>
    var mySwiper = new Swiper('.swiper-container', {
        loop: true, // 循环模式选项
        autoplay: {
            delay: 3500, // 3.5秒切换一次
        }, // 自动切换
        // 如果需要分页器
        pagination: {
            el: '.swiper-pagination',
        },
        // 如果需要前进后退按钮
        navigation: {
            nextEl: '.swiper-button-next',
            prevEl: '.swiper-button-prev',
        },
    })
</script>
</body>
</html>
